Skip to content

fix(source): read the web source behind UHD and another tag - #84

Open
zze0s wants to merge 1 commit into
feat/typed-source-codec-resolutionfrom
fix/uhd-web-source
Open

zze0s wants to merge 1 commit into
feat/typed-source-codec-resolutionfrom
fix/uhd-web-source

Conversation

@zze0s

@zze0s zze0s commented Nov 18, 2026

Copy link
Copy Markdown

Description

Stacked on #83. The first piece of step 7, and the one that needs no decision: it lets qui drop a workaround that walks the tags of a release.

A bare UHD is the source row UHD.BluRay. fixSourceUHD already joined it with a web source next to it, but only across resolution, frame rate, HDR and bit depth tags. A streaming service between the two stopped it:

name before after
Movie.2020.2160p.UHD.AMZN.WEB-DL.DDP5.1.HDR.H.265-GRP UHD.BluRay UHD.WEB-DL
Show.S01E02.2160p.UHD.NF.WEBRip.x265-GRP UHD.BluRay UHD.WEBRiP
Movie.2020.German.DL.2160p.UHD.NF.WEB.H265-GRP UHD.BluRay UHD.WEB
Movie.2020.2160p.UHD.IMAX.WEB-DL.x265-GRP UHD.BluRay UHD.WEB-DL
Movie.2020.2160p.WEB-DL.AMZN.UHD.x265-GRP WEB-DL UHD.WEB-DL

The change, all in fixSourceUHD and nextSource in parse.go:

  • The old walk runs first, unchanged. A name it could join reads as before.
  • When it finds no web or TV source, a second walk also passes collection, cut, edition, language and other tags, and joins with WEB, WEB-DL or WEBRiP.
  • Not in a name that names a disc: a remux, a full disc (BDMV) or a BluRay source anywhere in the name. The web words of such a name are those of a track or of a hybrid.

Codec, audio and channels still stop the walk. They stand behind the source in a name written the usual way, and past them a web word is the group or the source of an audio track.

These keep UHD.BluRay:

Dune.Part.Two.2024.2160p.UHD.REMUX.DV.HDR.TrueHD.7.1.Atmos-GRP
Movie.2020.UHD.2160p.REMUX.HEVC.TrueHD.Atmos.7.1.AMZN.WEB-DL.DDP5.1.Audio-GRP
Movie.2020.2160p.UHD.German.DL.DV.HDR.x265-GRP
Movie.2020.2160p.UHD.AMZN.x265-GRP
Movie.2020.2160p.UHD.x265-WEB
The.Web.Planet.2160p.UHD.x265-GRP

What changes, by set

Against #83: 0 of 54,766 real scene names, 0 of 13,215 nyaa names and 0 of 2,505 sports names change, and the CLI output over the scene and nyaa names is byte-identical. None of those sets holds the shape. So the evidence is built names:

  • 11 rows in tests.yaml and 3 probe rows, the only rows of either that change.
  • A reviewer's 60,455 names, hand-written and generated around the shape. 3,164 change, every one of them the join above, forwards or backwards, and in Source only. No name goes from a web reading to UHD.BluRay, and no name with a remux or a BluRay goes to a web reading.

No new source value: TestTypedProduced still walks every value the parser gives.

Against qui's workaround

qui reads the same thing after the parse with enrichUHDWebSource. On a grid of 1,320 names (every web source row, with and without a tag of each type between, dots, spaces and underscores, film and episode), the workaround fires on 1,098. rls changes no name where it does not fire.

case names
WEB, WEB-DL or WEBRiP behind a collection, other, cut, edition or language tag 288 the same answer
WEB, WEB-DL or WEBRiP behind a codec, an audio tag, a title word, a version, a container or a region 216 the workaround joins, rls keeps UHD.BluRay
a web source with no UHD. row (WEBSCR, WEB-HD, WebHDRiP) 594 the workaround makes values that have no row (UHD.WEBSCR), rls keeps UHD.BluRay

Downstream impact on autobrr and qui

qui can drop enrichUHDWebSource: 25 lines removed in a local commit, not pushed. Its tests for the workaround stay unchanged and now test the parse; they have AMZN and NF between. With it, qui builds and its 11 packages that use rls pass against this commit.

autobrr needs no change. It builds and fails only the two tests that fail against master. A UHD.AMZN.WEB-DL name now stores source UHD.WEB-DL where it stored UHD.BluRay, so its hash changes and a filter on source UHD.BluRay no longer matches it, which is the fix.

Known limits

  • Movie.2020.2160p.UHD.NF-WEB joins with the group WEB behind the streaming service and reads UHD.WEB.
  • UHD as a word of a title in a record or a game joins across a language or an edition word: Game.UHD.German.Web-GRP reads UHD.WEB. It read UHD.BluRay before, which was as wrong.
  • Movie.2020.UHD.2160p-WEB reads UHD.WEB, as on feat(source)!: type Source, Codec and Resolution #83. The row is in the probe set and in the list of known wrong readings.

Left out on purpose

Three things were written and taken out again, because each changes more than Source and we have no real name for any of them. The evidence is kept for a later change:

  • A web source with no UHD. row turning the UHD into the resolution, so that UHD.WEBSCR is a screener.
  • A written resolution winning over a UHD made a resolution: Show.S01E01.UHD.HDTV.1080p gives 2160p today.
  • Show.S01E02.2160p.UHD.AMZN.HDTV reading HDTV. It stays UHD.BluRay, as a probe row in the list of known wrong readings.

Review

An independent review compared the first version with #83 on its own names. It found a hyphen stop that turned Movie (2020) 2160p UHD - WEB-DL x265 into a BluRay, a remux with web audio read as a web source, and tests that did not hold five of the eight tag types. All fixed here: each tag type the walk passes and each guard now fails a test when taken out, 16 of 16.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

  • The rows added to tests.yaml and to the probe sets, and the removal test described above.
  • The differential, the reviewer's names and the grid above.
  • go vet ./..., gofmt -l . with Go 1.26 and 1.27, go test ./... with the corpus present, go test -race ./..., the cmd/rls checks and 60 s of FuzzParseString.
  • Benchmarks, six alternating rounds: Parse, ParseTags and Build within noise, allocations unchanged.

Checklist

  • I ran go fmt and the test suite passes locally
  • I added cases to tests.yaml for any parsing change
  • If this adds or renames a normalized value (source, codec, HDR, etc.), I noted the downstream impact on autobrr/qui
  • I have linked any related issue (none)

AI disclosure

Yes, all of it. Claude Code (Claude Fable 5.2) wrote and checked it, and a second model run reviewed it. The names in the tests are built to the shape and are not real releases.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b3fa90b9-2a7b-4bad-a1d6-72b3f6d681d2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A bare UHD found its web source only across resolution, frame rate, HDR
and bit depth tags, so a streaming service between them made the release
a UHD BluRay: 'Movie.2020.2160p.UHD.AMZN.WEB-DL' gave 'UHD.BluRay' and
now gives 'UHD.WEB-DL', 'Show.S01E02.2160p.UHD.NF.WEBRip' 'UHD.WEBRiP'.

fixSourceUHD keeps its walk unchanged, the tv branch included. When that
finds no web or tv source, it walks again past collection, cut, edition,
language and other tags, and joins a WEB, WEB-DL or WEBRiP there. The
second walk is not taken in a name with a remux, a full disc or a
bluray, whose web words are those of a track or a hybrid. The codec,
audio and channels stop both walks, as past them a web word is the group
('UHD.x265-WEB') or a track's source.

Two joins of the second walk are known and left: a web group behind the
streaming service is still a source tag then, so
'Movie.2020.2160p.UHD.NF-WEB' gives 'UHD.WEB', and a UHD that is a word
of the title of a record or a game joins across a language or an edition
word ('Game.UHD.German.Web-GRP' gives 'UHD.WEB', and gave 'UHD.BluRay';
both are wrong). A tv source past the streaming service stays a bluray
('Show.S01E02.2160p.UHD.AMZN.HDTV', held in probeFailures).

No name of the nyaa and sports corpora, the probe sets or 54,766 real
scene names changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant